import { _decorator, Component, Node } from 'cc';
import { PlayBaseUser } from '../PlayBaseUser';
import { GameTrainLogic } from './GameTrainLogic';
import { BelognBallType } from './GameConstant2';
import { BLACK_BALL } from '../GameManage';
const { ccclass, property } = _decorator;

export class TrainPlayBase extends PlayBaseUser {
    
    private _ballType : BelognBallType = BelognBallType.NONE

    gameLogic : GameTrainLogic = null

    constructor(gameLogic : GameTrainLogic) {
        super()
        this.gameLogic = gameLogic
    }

    // 设置所属的球类型
    set ballType(ballType : BelognBallType) {
        this._ballType = ballType
    }

    get ballType() : BelognBallType {
        return this._ballType
    }

    // 是否是属于我的球
    isBelognMine(ballNumber : number) {

        if(ballNumber != BLACK_BALL) {
            return this.allBallList.includes(ballNumber)
        }

        // 判断我的列表是否包含黑球
        return this.ballList.includes(ballNumber)
        
    }


}